<template>
  <div class="ii-wrap">
    <div class="ii-wrap-left-tb">
      <div class="ii-wrap-left">
        <div class="ii-wrap-left-one" :class="toolsIndex === 1 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(1)">结案报告</div>
        <div class="ii-wrap-left-one" :class="toolsIndex === 2 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(2)">直播热词</div>
        <div class="ii-wrap-left-one" :class="toolsIndex === 3 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(3)">聊天话题</div>
        <div class="ii-wrap-left-one" :class="toolsIndex === 4 ? 'ii-line-active && ii-text-active': ''" @click="toggleIndex(4)">红人解析</div>
      </div>
      </div>
    <div class="li-wrap-right">
      <nuxt-child/>
    </div>
  </div>
</template>
<script>
export default {
  async fetch({store}) {
    await store.commit('setInterIndex', 9)
  },
  layout: 'internalouts', 
  components: {
    
  },
  computed: { 
    toolsIndex(){
      return  this.$store.state.toolsIndex
    }
  },
  data() {
    return {
      index: 0, // 初始索引值
    }
  },
  methods: {
    toggleIndex(index) {
      this.$store.commit('setToolsIndex', index)
      this.index = index
      switch(index){
        case 1:  this.go('/moreTools/report') 
        break;
        case 2:  this.go('/moreTools/hotWords') 
        break;
        case 3:  this.go('/moreTools/topic')
        break;
        case 4:  this.go('/moreTools/hotPeople')
        break;
      }
    },
  },
  mounted(){
   
  }
}
</script>

<style scoped>
  .ii-wrap {
    display: flex;
    justify-content: space-between;
    min-width:1200px;
  }
  .ii-wrap-left {
    background: #efefef;
    width: 220px;
    border-radius: 4px;
    font-weight:bold;
  }
  .li-wrap-right {
    flex:1;
    margin: 20px;
    min-width:940px;
  }
  .ii-wrap-left-one {
    border-bottom: 1px solid #f4f4f4;
    line-height: 50px;
    padding-left: 30px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    position: relative;
    user-select: none;
  }
  .ii-wrap-left-item {
    border-bottom: 1px solid #f4f4f4;
    padding-bottom: 20px;
    user-select: none;
  }
  .ii-wrap-left-item p {
    cursor: pointer;
  }
  .ii-wrap-left-item .p1 {
    font-size: 14px;
    color: #333;
    position: relative;
    height: 50px;
    line-height: 50px;
    padding-left: 30px;
  }
  .ii-wrap-left-item .p2 {
    font-size: 14px;
    color: #666;
    padding-left: 30px;
  }
 .ii-wrap-left-item .p3 {
    margin-top: 20px;
  }
  .ii-wrap-left-last {
    height: 50px;
    line-height: 50px;
    padding-left: 30px;
    font-size: 14px;  
    color: #333;
    cursor: pointer;
    position: relative;
    border-bottom: 1px solid #f4f4f4;
  }
  .ii-line-active::before {
    content: '';
    width: 3px;
    height: 26px;
    background: #0096e6;
    position: absolute;
    left: 0;
    top: 12px;
  }
  .ii-text-active {
    color: #0096e6 !important;
    background:#e6e6e6;
  }
  .ii-wrap-left-tb{
    width:220px;
    background:#efefef;
    box-shadow:0 -4px 5px #f4f4f4;
  }
  .ii-wrap-left-t{
    width:222px;
    height:120px;
    background:#ffffff;
    display:flex;
    align-items:center;
    flex-direction:column;
    justify-content:center;
    border-radius:4px;
  }
  .ii-bg-h{
    width:222px;
    height:20px;
    background:#f4f4f4
  }
  .ii-wrap-left-t-img{
    width:44px;
    height:44px;
  }
  .ii-wrap-left-t-img img{
    width:100%;
    height:100%;
  }
  .ii-wrap-left-t-text{
    font-size:16px;
    margin-top:13px;
    font-weight:400;
  }
</style>

